using Moq;

namespace UnitTesting.Fixturing.Moq
{
	public class Fixture : DefaultFixture
	{
		readonly MockSettings _mockSettings = new MockSettings();

		protected override object FixtureOptions
		{
			get { return _mockSettings; }
		}

		static Fixture()
		{
			ActivatorManager.SetCurrent(new FixtureMockActivator());
		}

		public Fixture OnMockDefaultAsDefault()
		{
			_mockSettings.FixtureMockDefaultValue = FixtureMockDefaultValue.Empty;
			return this;
		}

		public Fixture OnMockDefaultAsEmpty()
		{
			_mockSettings.FixtureMockDefaultValue = FixtureMockDefaultValue.Empty;
			return this;
		}

		public Fixture OnMockDefaultAsMock()
		{
			_mockSettings.FixtureMockDefaultValue = FixtureMockDefaultValue.Mock;
			return this;
		}

		public Fixture OnMockDefaultAsFixture()
		{
			_mockSettings.FixtureMockDefaultValue = FixtureMockDefaultValue.Fixture;
			return this;
		}

		public Fixture OnMockCallBaseAsDefault()
		{
			_mockSettings.MockCallBase = false;
			return this;
		}

		public Fixture OnMockCallBaseAsFalse()
		{
			_mockSettings.MockCallBase = false;
			return this;
		}

		public Fixture OnMockCallBaseAsTrue()
		{
			_mockSettings.MockCallBase = true;
			return this;
		}

		public Fixture OnMockBehaviorAsDefault()
		{
			_mockSettings.MockBehavior = MockBehavior.Loose;
			return this;
		}

		public Fixture OnMockBehaviorAsLoose()
		{
			_mockSettings.MockBehavior = MockBehavior.Loose;
			return this;
		}

		public Fixture OnMockBehaviorAsStrict()
		{
			_mockSettings.MockBehavior = MockBehavior.Strict;
			return this;
		}

		public Fixture OnAllMockSettingsAsDefault()
		{
			OnMockDefaultAsDefault();
			OnMockCallBaseAsDefault();
			OnMockBehaviorAsDefault();
			return this;
		}
	}
}